package com.example.hrsystem.workflow.model;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.hrsystem.data.source.DateTypeConverters;

import java.util.Date;

/**
 * 流程定义实体类
 * 代表一个工作流的定义模板
 */
@Entity(tableName = "process_definitions")
public class ProcessDefinition {
    @PrimaryKey(autoGenerate = true)
    private int id;

    // 流程定义唯一标识符
    private String processKey;
    
    // 流程定义名称
    private String name;
    
    // 流程定义描述
    private String description;
    
    // 流程定义版本
    private int version;
    
    // 流程定义内容（JSON/XML格式）
    private String definitionContent;
    
    // 创建时间
    @TypeConverters(DateTypeConverters.class)
    private Date createdAt;
    
    // 更新时间
    @TypeConverters(DateTypeConverters.class)
    private Date updatedAt;

    // 构造函数
    public ProcessDefinition() {}

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProcessKey() {
        return processKey;
    }

    public void setProcessKey(String processKey) {
        this.processKey = processKey;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getDefinitionContent() {
        return definitionContent;
    }

    public void setDefinitionContent(String definitionContent) {
        this.definitionContent = definitionContent;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
}